<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
	
function CreatePerson(name, salary)   //构造函数
	{
				var obj = new Object();
				obj.name= name;
				obj.salary = salary;
		
				obj.showName = function()
				{
					alert(this.name);
				};
	
				obj.showSalary = function()
				{
					alert(this.salary);
				};
				
		return obj;
	}
	
	var obj = CreatePerson('albert',35000);
	
	obj.showName();
	obj.showSalary();
	
	var obj2 = CreatePerson('albert',55000);
	
	obj2.showName();
	obj2.showSalary();
	
</script>
</head>

<body>
</body>
</html>
